import httpUtil from "@/utils/httpUtil";
import messageUtil from "../utils/messageUtil";

/**
 * 通过手机号获取运营商相关信息
 * @param phone
 * @param backMethod
 * @return {JSON} {"Mobile": "13880104834","Province": "四川","City": "成都","Isp": "中国移动"}
 */
const getOperator = (mobile, backMethod) => {


	httpUtil.postReturnSource('/api/jssxk/getYys', {
		mobile
	}, res => {
		// {"code": 0,"reason": "Succ","result": {"Mobile": "13880104834","Province": "四川","City": "成都","Isp": "中国移动"}}
		console.log('getOperator', res)
		if (res.reason != 'Succ' || res.code != 0) {
			messageUtil.showFail('获取运营商失败，请于管理员联系')
			return;
		}
		backMethod(res.result);
	})


}

export default {
	getOperator
}
